home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_02_12
/
2n12052a
< prev
next >
Wrap
Text File
|
1991-10-28
|
631b
|
19 lines
Function StrCon(Dest:PCHAR;Letter:Char;Width, Size:Integer):PCHAR;
begin
StrCon := Dest; { Return Dest }
if Dest = NIL then EXIT; { Don't fill a NIL! }
if Width >= Size then
Width := Size; { Always keep in bounds - don't overwrite }
ASM
LES DI, Dest { Get Address of DEST in ES:DI }
CLD { Set direction forward }
MOV CX, Width { count in CX }
MOV AL, Letter
REP STOSB { make string of characters }
MOV AL, 0 { Null Terminate }
STOSB { and store }
end
end;